<?php

namespace app\admin\model;

use app\admin\model\BaseModel;


class Product extends BaseModel
{

    protected $name = "product";
    protected $pk = "id";
    // 追加属性
    protected $append = ['table_status_text', 'tf_status_text'];
    protected $deleteTime = false;


    public function getTableStausList()
    {
        return ['1' => '已生成'];
    }

    public function getTableStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['table_status']) ? $data['table_status'] : '');
        $list = $this->getTableStausList();
        return isset($list[$value]) ? $list[$value] : '未生成';
    }

    public function getTfStatusList()
    {
        return ['0' => '可投放', '1' => '不可投放'];
    }

    public function getTfStatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['tf_status']) ? $data['tf_status'] : '');
        $list = $this->getTfStatusList();
        return isset($list[$value]) ? $list[$value] : '可投放';
    }
}
